home *** CD-ROM | disk | FTP | other *** search
/ GFX Sensations 1 / Graphic Sensations - Volume 1.iso / tools / amiga / gfx_card / pap12pat.lha / PAP11patch.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1994-06-04  |  5.0 KB  |  191 lines

  1. /* Update Part And Particle v1.0 to v1.1 */
  2. /*                                       */
  3. /*          ©1994 Carmen Rizzolo         */
  4. /*                                       */
  5.  
  6. Options Results
  7. Address Command
  8. Quote = "'"
  9.  
  10. Say
  11. Say
  12.  
  13. If Exists('OpalPaint:Rexx/PAP1.oprx') = 0 Then Do
  14.     Say 'I cannot seem to find the Part And Particle v1 file!'
  15.     If Exists('Rexx:PAP1.oprx') = 0 Then Do
  16.         Say 'Nope.  Definently not there.  Exiting...'
  17.         Exit
  18.         End
  19.     End
  20.  
  21. If Exists('OpalPaint:Rexx/PAP1.oprx') = 1 Then Say 'PAP1.oprx found in OpalPaint:Rexx/'
  22. If Exists('Rexx:PAP1.oprx') = 1 & Exists('OpalPaint:Rexx/PAP1.oprx') = 0 Then Say 'Okay, there it is... In Rexx:'
  23.  
  24. If Exists('OpalPaint:Rexx/PAP1.oprx') = 1 Then PAPDir = 'OpalPaint:Rexx/'
  25. Else If Exists('Rexx:PAP1.oprx') = 1 Then PAPDir = 'Rexx:'
  26.  
  27. Say
  28. Say
  29. Say 'WARNING!  Your PAP1.oprx file MUST be the original, unmodified file'
  30. Say 'that came from your PAP installation.  Shall I continue? (y/n)'
  31. Pull YesNo
  32.  
  33. If UPPER(Left(YesNo,1)) ~= 'Y' Then Do
  34.     Say
  35.     Say 'Operation aborted.. Have a nice day.'
  36.     Exit
  37.     End
  38.  
  39. Say
  40. Say
  41. Say 'Stand By: Upgrading...'
  42.  
  43. 'Copy ' || PAPDir || 'PAP1.oprx Ram: Quiet'
  44.  
  45. Call Open('PAP1File','Ram:PAP1.oprx','r')
  46.  
  47. Do A = 1 to 348
  48.     AA = ReadLn('PAP1File')
  49.     End
  50.  
  51. If Right(AA,25) ~= '"Part And Particle v1.0"' || Quote Then Do
  52.     Say 'FATAL ERROR!  It appears that this is NOT Part And Particle'
  53.     Say 'version 1.0!  Either that or the file has been modified.'
  54.     Say 'Please re-install Part And Particle from the original disks'
  55.     Say 'before trying this script again.  Exiting...'
  56.     Exit
  57.     End
  58.  
  59. Call Close('PAP1File')
  60.  
  61. Call Open('PAP1File','Ram:PAP1.oprx','r')
  62. Call Open('PAP11File','Ram:PAP11.oprx','w')
  63.  
  64. Call WriteLn('PAP11File','/*                        */')
  65. Call WriteLn('PAP11File','/* Part and Particle v1.1 */')
  66. Call WriteLn('PAP11File','/*                        */')
  67. Call WriteLn('PAP11File','/*  ©1994 Carmen Rizzolo  */')
  68. Call WriteLn('PAP11File','/*                        */')
  69. Call WriteLn('PAP11File','/*                        */')
  70.  
  71. Do A = 1 to 6
  72.     AA = ReadLn('PAP1File')
  73.     End
  74.  
  75. Do A = 1 to 225
  76.     AA = ReadLn('PAP1File')
  77.     Call WriteLn('PAP11File',AA)
  78.     End
  79.  
  80. AA = ReadLn('PAP1File')
  81. NewLine = '                  If MainLoop > StartFrame Then Do'
  82. Call WriteLn('PAP11File',NewLine)
  83.  
  84. Do A = 1 to 20
  85.     AA = ReadLn('PAP1File')
  86.     Call WriteLn('PAP11File',AA)
  87.     End
  88.  
  89. NewLine = '                         If MainLoop > StartFrame Then Do'
  90. Call WriteLn('PAP11File',NewLine)
  91. NewLine = '                               If ModuleMode = 1 Then Call DoParticles()'
  92. Call WriteLn('PAP11File',NewLine)
  93. NewLine = '                               If ModuleMode = 4 Then Call DoParticles()'
  94. Call WriteLn('PAP11File',NewLine)
  95. NewLine = '                               If ModuleMode = 5 Then Call DoParticles()'
  96. Call WriteLn('PAP11File',NewLine)
  97. NewLine = '                               If ModuleMode = 6 Then Call DoParticles()'
  98. Call WriteLn('PAP11File',NewLine)
  99. NewLine = '                               If ModuleMode = 7 Then Call DoParticles()'
  100. Call WriteLn('PAP11File',NewLine)
  101. NewLine = '                               End'
  102. Call WriteLn('PAP11File',NewLine)
  103.  
  104. Do A = 1 to 5
  105.     AA = ReadLn('PAP1File')
  106.     End
  107.  
  108. Do A = 1 to 6
  109.     AA = ReadLn('PAP1File')
  110.     Call WriteLn('PAP11File',AA)
  111.     End
  112.  
  113. NewLine = '                  If MainLoop > StartFrame Then Call PrepParticlesForDraw()'
  114. Call WriteLn('PAP11File',NewLine)
  115. Call ReadLn('PAP1File')
  116.  
  117. Do A = 1 to 83
  118.     AA = ReadLn('PAP1File')
  119.     Call WriteLn('PAP11File',AA)
  120.     End
  121.  
  122. NewLine = '      AddHeading ' || Quote || 'CenterX 20 "Part And Particle v1.1"' || Quote
  123. Call WriteLn('PAP11File',NewLine)
  124. NewLine = '      AddHeading ' || Quote || 'CenterX 30 "©1994 Carmen Rizzolo"' || Quote
  125. Call WriteLn('PAP11File',NewLine)
  126. NewLine = '      AddHeading ' || Quote || 'CenterX 45 "an Arexx script for OpalPaint v2.3 or higher"' || Quote
  127. Call WriteLn('PAP11File',NewLine)
  128. Call ReadLn('PAP1File')
  129. Call ReadLn('PAP1File')
  130. Call ReadLn('PAP1File')
  131.  
  132. Do A = 1 to 1969
  133.     AA = ReadLn('PAP1File')
  134.     Call WriteLn('PAP11File',AA)
  135.     End
  136.  
  137. NewLine = '      Do AA = StartFrame to MainLoop'
  138. Call WriteLn('PAP11File',NewLine)
  139. Call ReadLn('PAP1File')
  140.  
  141. Do A = 1 to 17
  142.     AA = ReadLn('PAP1File')
  143.     Call WriteLn('PAP11File',AA)
  144.     End
  145.  
  146. NewLine = '            Do AA = StartFrame to FirstOne'
  147. Call WriteLn('PAP11File',NewLine)
  148. Call ReadLn('PAP1File')
  149.  
  150. Do A = 1 to 46
  151.     AA = ReadLn('PAP1File')
  152.     Call WriteLn('PAP11File',AA)
  153.     End
  154.  
  155. NewLine = '      Do AA = StartFrame to (MainLoop - 1)'
  156. Call WriteLn('PAP11File',NewLine)
  157. Call ReadLn('PAP1File')
  158.  
  159. Do A = 1 to 17
  160.     AA = ReadLn('PAP1File')
  161.     Call WriteLn('PAP11File',AA)
  162.     End
  163.  
  164. NewLine = '            Do AA = StartFrame to FirstOne'
  165. Call WriteLn('PAP11File',NewLine)
  166. Call ReadLn('PAP1File')
  167.  
  168. Do A = 1 to 1769
  169.     AA = ReadLn('PAP1File')
  170.     Call WriteLn('PAP11File',AA)
  171.     End
  172.  
  173. Call Close('PAP1File')
  174. Call Close('PAP11File')
  175.  
  176. Say '...done'
  177.  
  178. If Exists('OpalPaint:Rexx/') = 1 Then 'Copy Ram:PAP11.oprx ' || PAPDir || ' QUIET'
  179.  
  180. Delete 'Ram:PAP1.oprx Quiet'
  181. Delete 'Ram:PAP11.oprx Quiet'
  182.  
  183. Say
  184. Say 'Operation complete!'
  185. Say 'PAP11.oprx (Part And Particle v1.1) is now in your'
  186. Say PAPDir || ' directory.'
  187. Say
  188. Say 'Exiting...'
  189.  
  190. Exit
  191.